package org.chintoooor.trio.server.http;

import java.util.Properties;

public class HttpRequest {

	private HttpOperation httpOperation;
	private String location;
	private String httpVersion;

	private Properties headerProperties;

	private String messageBody;
	private RuntimeException parseException;

	public HttpRequest() {
		super();
		headerProperties = new Properties();
	}

	public final HttpOperation getHttpOperation() {
		return httpOperation;
	}

	public final void setHttpOperation(HttpOperation httpOperation) {
		this.httpOperation = httpOperation;
	}

	public final String getLocation() {
		return location;
	}

	public final void setLocation(String location) {
		this.location = location;
	}

	public final String getHttpVersion() {
		return httpVersion;
	}

	public final void setHttpVersion(String httpVersion) {
		this.httpVersion = httpVersion;
	}

	public final Properties getHeaderProperties() {
		return headerProperties;
	}

	public final void setHeaderProperties(Properties headerProperties) {
		this.headerProperties = headerProperties;
	}

	public final String getMessageBody() {
		return messageBody;
	}

	public final void setMessageBody(String messageBody) {
		this.messageBody = messageBody;
	}

	public String setProperty(String key, String value) {
		return (String) headerProperties.setProperty(key, value);
	}

	public final RuntimeException getParseException() {
		return parseException;
	}

	public final void setParseException(RuntimeException runtimeException) {
		this.parseException = runtimeException;

	}

	@Override
	public String toString() {
		return "HttpRequest [httpOperation=" + httpOperation + ", location="
				+ location + ", httpVersion=" + httpVersion
				+ ", headerProperties=" + headerProperties + ", messageBody="
				+ messageBody + ", parseException=" + parseException + "]";
	}

}
